package com.kkb.kkbportal.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kkb.kkbcommon.exception.Asserts;
import com.kkb.kkbportal.dao.PartnerDao;
import com.kkb.kkbportal.domain.Partner;
import com.kkb.kkbportal.service.PartnerService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ${黄柯}
 * @since 2021-08-14
 */
@Service
public class PartnerServiceImpl extends ServiceImpl<PartnerDao, Partner> implements PartnerService {

    /**
     * 查询合作伙伴信息列表
     *
     * @return
     */
    @Override
    public List<Partner> listAll() {
        QueryWrapper<Partner> wrapper = new QueryWrapper<Partner>()
                .eq("is_deleted", 0);
        List<Partner> list = list(wrapper);
        if (ObjectUtil.isNull(list)) {
            Asserts.fail("未查询到合作伙伴数据");
        }
        return list;
    }


}















